﻿using IHISCETeim.BLL;
using IHISCETeim.Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using IHISCETeim.Library;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;

namespace IHISCETeim.Web.MachineSys.MacModel
{
    public partial class OFactoryRenovationAdd : PageBase
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.新增 };
            }
        }
        protected override string DWZRef
        {
            get { return "OFactoryRenovationList"; }

        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (GetRequestValue<string>("ajaxmethod", "") == "add")
            {
                add();//
            }
        }
        private void add()
        {
            if (base.User.UserType != 1)
                return;
            OFactoryRenovationInfo obj = Request.SerializableObject<OFactoryRenovationInfo>();
            obj.Num = 1;


            int R = OFactoryRenovationController.Add(obj);
            switch (R)
            {              
                case 0:
                    ErrorJson("新增失败");
                    break;
                default:
                    SuccessJson("新增成功", this.DWZRef);
                    break;
            }
        }
    }
}